#include "OtherEle.h"
#include "Dot.h"

OtherEle :: OtherEle(Dot* dot)
{
	this->dot = dot;
	mapX = 0;
	mapY = 0;
}

void OtherEle :: process(Uint8* keys)
{
	mapX = dot->getY() / SIZEY;
	mapY = dot->getX() / SIZEX;
	if(Manager :: map[mapX][mapY] == -1)
	{
		if(keys[SDLK_7])
			Manager :: map[mapX][mapY] = 7;
		else if(keys[SDLK_8])
			Manager :: map[mapX][mapY] = 8;
		else if(keys[SDLK_9])
			Manager :: map[mapX][mapY] = 9;
		else if(keys[SDLK_q])
			Manager :: map[mapX][mapY] = 10;
	}
}

void OtherEle :: undo()
{
	Manager :: map[mapX][mapY] = -1;
}